import React from 'react'
import '../css/Headers.css'

class Headers extends React.Component {
	constructor(props) {
		super(props)
		this.state = {
			title: '',
			isShow: '',
		}
		// console.log(this.props);
	}

	componentDidMount() {
		this.setState({
			title: this.props.title,
			isShow: this.props.isShow,
		})
		// console.log(this.props.isShow)
	}

	render() {
		return (
			<div className="nav">
				<ul>
					{this.state.isShow ? <li>返回</li> : <li></li>}
					<li>{this.state.title}</li>
					<li
						onClick={() => {
							this.props.sendMessage('我是子传父')
						}}
					>
						编辑
					</li>
				</ul>
			</div>
		)
	}
}

export default Headers
